package cn.tedu.Innerclass;

import org.junit.jupiter.api.Test;

public class TestInner4 {
    @Test
    public void test(){
        new Outer4().show();
    }
}

class Outer4 {
    public void show() {
        class Inner4 {
            String name;
            int age;
            /*如何使用内部类的资源
             * 创建对象*/

            public void eat() {
                System.out.println("Inner eat");
            }

        }
        Inner4 inner4 = new Inner4();
        System.out.println(inner4.age);
        System.out.println(inner4.name);
        inner4.eat();
    }
}
